package com.yxw.yxnet_cd_center.customer_service.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yxw.yxnet_cd_center.customer_service.dto.FlockQueryDTO;
import com.yxw.yxnet_cd_center.customer_service.entity.YxCsFlockEntity;
import com.yxw.yxnet_cd_center.customer_service.entity.YxCsFlowRuleEntity;
import com.yxw.yxnet_cd_center.customer_service.vo.YxCsFlockVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 工作群管理
 * @author liuxin
 * @date 2023-09-17
 */
@Repository
public interface FlockMapper extends BaseMapper<YxCsFlockEntity> {


    /**
     * 新增群成员
     * @param flockId
     * @param userIdList
     */
    void addFlockUser(@Param("flockId") Long flockId,@Param("list") List<Long> userIdList);

    /**
     * 分流管理-群列表查询
     * @param page
     * @param dto
     * @return
     */
    List<YxCsFlockVo> getFlockList(Page<YxCsFlockVo> page,@Param("dto") FlockQueryDTO dto);


    /**
     * 根据群消息查询渠道-端口-组
     * @param flockId
     * @return
     */
    YxCsFlowRuleEntity getFlowRuleByFlockId(Long flockId);

    /**
     * 删除群聊人员
     * @param flockId
     */
    void deleteFlockUserById(Long flockId);

    /**
     * 禁用群
     * @param flockId
     * @param status
     */
    void updateFlockStatus(@Param("flockId") Long flockId, @Param("status")int status);
}
